import request from '@/uilts/request'
// 工单状态
export const OrderStatusRequest = () => {
  return request({
    url: '/api/task-service/task/allTaskStatus'
  })
}
// 工单搜索
export const OrderSearchRequest = ({ pageIndex, pageSize, isRepair, status, taskCode }) => {
  return request({
    url: '/api/task-service/task/search',
    params: {
      pageIndex,
      pageSize,
      isRepair,
      status,
      taskCode
    }
  })
}
// 运营人员列表
export const OperatorsRequest = (innerCode) => {
  return request({
    url: `/api/user-service/user/operatorList/${innerCode}`
  })
}
// 创建工单
export const CreateJobRequest = ({ createType, innerCode, userId, productType, desc, details, assignorId }) => {
  return request({
    url: '/api/task-service/task/create',
    method: 'POST',
    data: {
      createType,
      innerCode,
      userId,
      productType,
      desc,
      details,
      assignorId
    }
  })
}
// 补货详情
export const RepleniShmentDetailsRequest = (innerCode) => {
  return request({
    url: `/api/vm-service/channel/channelList/${innerCode}`
  })
}
// 补货预警值
export const WarningValueRequest = () => {
  return request({
    url: '/api/task-service/task/supplyAlertValue'
  })
}
// 设置补货阈值
export const SetValueRequest = (alertValue) => {
  return request({
    url: '/api/task-service/task/autoSupplyConfig',
    method: 'POST',
    data: {
      alertValue
    }
  })
}
// 所有工单类型
export const GetOrderTypeRequest = () => {
  return request({
    url: '/api/task-service/taskType/list'
  })
}
// 获取当前工单详情
export const GetOrderMegRequest = (taskId) => {
  return request({
    url: `/api/task-service/task/taskInfo/${taskId}`
  })
}
// 取消当前工单
export const RemoveOrderMegRequest = (data) => {
  return request({
    url: `/api/task-service/task/cancel/${data.taskId}`,
    method: 'POST',
    data
  })
}
// 补货详情
export const RepleniShmentMegRequest = (taskId) => {
  return request({
    url: `/api/task-service/taskDetails/${taskId}`
  })
}
